# Contributor: Galen Abell <galen@galenabell.com>
# Maintainer: Galen Abell <galen@galenabell.com>
pkgname=py3-caldav
pkgver=1.3.9
pkgrel=0
pkgdesc="caldav client library for Python"
url="https://github.com/python-caldav/caldav"
arch="noarch"
license="GPL-3.0-only AND Apache-2.0"
depends="
	py3-icalendar
	py3-lxml
	py3-recurring-ical-events
	py3-requests
	py3-tz
	py3-tzlocal
	py3-vobject
	"
makedepends="py3-gpep517 py3-setuptools py3-wheel"
checkdepends="py3-pytest"
subpackages="$pkgname-pyc"
source="$pkgname-$pkgver.tar.gz::https://github.com/python-caldav/caldav/archive/v$pkgver.tar.gz"
builddir="$srcdir/caldav-$pkgver"

build() {
	gpep517 build-wheel \
		--wheel-dir .dist \
		--output-fd 3 3>&1 >&2
}

check() {
	python3 -m venv --clear --system-site-packages .testenv
	.testenv/bin/python3 -m installer .dist/*.whl
	.testenv/bin/python3 -m pytest
}

package() {
	python3 -m installer -d "$pkgdir" \
		.dist/*.whl
}

sha512sums="
f1912b26ce989ef8c7bd6278de20e26f265a5e9477fc168dc63c152b50a38faacf031cfb06f1d5f5e2333908c31cb75804c29d952227f5d58cd02a775956af77  py3-caldav-1.3.9.tar.gz
"
